home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / upc12bs1.zip / LIB / mkfilenm.c < prev    next >
C/C++ Source or Header  |  1993-10-03  |  3KB  |  63 lines

  1. /*--------------------------------------------------------------------*/
  2. /*       m k f i l e n a m e . c                                      */
  3. /*                                                                    */
  4. /*       Make a qualified file name from path name and simple file    */
  5. /*       name.                                                        */
  6. /*--------------------------------------------------------------------*/
  7.  
  8. /*--------------------------------------------------------------------*/
  9. /*    Changes Copyright (c) 1990-1993 by Kendra Electronic            */
  10. /*    Wonderworks.                                                    */
  11. /*                                                                    */
  12. /*    All rights reserved except those explicitly granted by the      */
  13. /*    UUPC/extended license agreement.                                */
  14. /*--------------------------------------------------------------------*/
  15.  
  16. /*--------------------------------------------------------------------*/
  17. /*                          RCS Information                           */
  18. /*--------------------------------------------------------------------*/
  19.  
  20. /*
  21.  *    $Id: mkfilenm.c 1.3 1993/10/03 20:37:34 ahd Exp $
  22.  *
  23.  *    Revision history:
  24.  *    $Log: mkfilenm.c $
  25.  *     Revision 1.3  1993/10/03  20:37:34  ahd
  26.  *     Don't formally normalize paths, invalid file names cause normalize()
  27.  *     to panic() in BCC for OS/2
  28.  *
  29.  *     Revision 1.2  1993/06/16  04:03:25  ahd
  30.  *     drop duplicated slashes (caused by root directory support *sigh*)
  31.  *
  32.  */
  33.  
  34. #include <stdio.h>
  35. #include <stdlib.h>
  36. #include <string.h>
  37. #include <time.h>
  38.  
  39. /*--------------------------------------------------------------------*/
  40. /*                    UUPC/extended include files                     */
  41. /*--------------------------------------------------------------------*/
  42.  
  43. #include "hlib.h"
  44. #include "lib.h"
  45.  
  46. /*--------------------------------------------------------------------*/
  47. /*    m k f i l e n a m e                                             */
  48. /*                                                                    */
  49. /*    Build a path name out of a directory name and a file name       */
  50. /*--------------------------------------------------------------------*/
  51.  
  52. void mkfilename(char *pathname,
  53.                 const char *path,
  54.                 const char *name)
  55. {
  56.    char *s = pathname;
  57.    sprintf(pathname, "%s/%s", path, name);
  58.  
  59.    while ((s = strchr(s, '\\')) != NULL)
  60.       *s++ = '/';                             /* Normalize slashes */
  61.  
  62. } /*mkfilename*/
  63.